///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package candidate.beans;
//
//import candidate.ejb.VideoProcesingEjb;
//import facades.CandidateLanguageInfoFacade;
//import facades.CandidateProfessionalInfoFacade;
//import entities.Candidate;
//import entities.CandidateLanguageInfo;
//import entities.CandidateProfessionalInfo;
//import java.io.Serializable;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//import javax.annotation.PostConstruct;
//import javax.enterprise.context.SessionScoped;
//import javax.enterprise.event.Observes;
//import javax.inject.Inject;
//import javax.inject.Named;
//import qualifiers.LoggedIn;
//
///**
// *
// * @author damfercer
// */
//@Named(value = "viewCandidateBean")
//@SessionScoped
//public class ViewCandidateBean implements Serializable {
//    @Inject
//    @LoggedIn
//    private Candidate candidate;
//    private CandidateLanguageInfo selectedLanguageInfo;
//    private List<String> imageList;
//    @Inject
//    private CandidateLanguageInfoFacade languageEJB;
//    @Inject
//    private CandidateProfessionalInfoFacade professionalEJB;
//    /**
//     * Creates a new instance of ViewCandidateBean
//     */
//    public ViewCandidateBean() {
//    }
//    
//    @PostConstruct
//    public void init(){
//        imageList=new ArrayList<String>();
//        if(getCandidate().getBustColor()!=null){
//            imageList.add(getCandidate().getBustColor());
//        }
//        if(getCandidate().getBustBlackWhite()!=null){
//            imageList.add(getCandidate().getBustBlackWhite());
//        }
//        if(getCandidate().getBodyFormal()!=null){
//            imageList.add(getCandidate().getBodyFormal());
//        }
//        if(getCandidate().getBodyUnformal()!=null){
//            imageList.add(getCandidate().getBodyUnformal());
//        }
//    }
//
//    /**
//     * @return the candidate
//     */
//    public Candidate getCandidate() {
//        return candidate;
//    }
//
//    /**
//     * @param candidate the candidate to set
//     */
//    public void setCandidate(Candidate candidate) {
//        this.candidate = candidate;
//    }
//    
//    public List<String> getImageList(){
//        return imageList;
//    }
//    
//    public String getIdFromCandidate(){
//        String res=null;
//        CandidateLanguageInfo best=languageEJB.getBestCandidateLanguageInfoVideo(getCandidate());
//        if(best!=null){
//            String[] array=best.getVideo().split("\\.");
//            res=array[0];
//        }
//        return res;
//    }
//    
//    public CandidateLanguageInfo getVideoIndex(){
//        return languageEJB.getBestCandidateLanguageInfoVideo(getCandidate());
//    }
//    
//    public String getIdFromCandidateLanguageInfo(CandidateLanguageInfo cli){
//        String res=null;
//        if(cli!=null){
//            String[] array=cli.getVideo().split("\\.");
//            res=array[0];
//        }
//        return res;
//    }
//    
//    public CandidateProfessionalInfo getBestProfessionalInfoFromCandidate(){
//        return professionalEJB.getBestCandidateProfessionalInfo(getCandidate());
//    }
//    
//    public Integer dateDifference(Date compare){
//        Date now=new Date();
//        long diff=now.getTime()-compare.getTime();
//        long days=diff / 1000 / 60 / 60 / 24 / 365;
//        return (int)days;
//    }
//
//    /**
//     * @return the selectedLanguageInfo
//     */
//    public CandidateLanguageInfo getSelectedLanguageInfo() {
//        return selectedLanguageInfo;
//    }
//
//    /**
//     * @param selectedLanguageInfo the selectedLanguageInfo to set
//     */
//    public void setSelectedLanguageInfo(CandidateLanguageInfo selectedLanguageInfo) {
//        this.selectedLanguageInfo = selectedLanguageInfo;
//    }
//}
